/**
 * @author ItJianGe
 * @data 2024/7/30 22:17
 */
public class Main {
    public static void main(String[] args) {

        PrototypeClone1 prototypeClone1 = new PrototypeClone1("一健");

        // 浅拷贝，没有再执行构造函数
        PrototypeClone1 clone1 = (PrototypeClone1) prototypeClone1.clone();
        System.out.println(clone1.getName());

        System.out.println("----------------------------------");

        PrototypeClone2 prototypeClone2 = new PrototypeClone2("yijian");

        // 深拷贝
        PrototypeClone2 clone2 = prototypeClone2.clone();
        System.out.println(clone2.getName());
        System.out.println(clone2.getNameList());
    }
}